﻿Public Class Inner
    Inherits System.Web.UI.MasterPage

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If HttpContext.Current.User.Identity.IsAuthenticated Then
            Dim user As MembershipUser = Membership.GetUser()
            Try
                Dim userId As Integer = user.ProviderUserKey
                lb_Home.PostBackUrl = "Default.aspx?UserId=" & userId.ToString()
                lb_Appointments.PostBackUrl = "AppointmentsList.aspx?UserId=" & userId.ToString()
                lb_Calendar.PostBackUrl = "Calendar.aspx?Date=" & Date.Today & "&UserId=" & userId.ToString()
            Catch ex As Exception
                HttpContext.Current.Session.Clear()
                FormsAuthentication.SignOut()
                Response.Write(ex.ToString())
                'Response.Redirect("Login.aspx")
            End Try
       End If
    End Sub
End Class